package com.itcast.mallapplet.controller.user;

import com.itcast.admin.entity.Seckill;
import com.itcast.applet.entity.Commodity;
import com.itcast.applet.entity.Sort;
import com.itcast.mallapplet.service.SeckillService;
import com.itcast.mallapplet.service.SortService;
import com.itcast.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/sort")
@Slf4j
@Api(tags = "用户端-分类模块")
public class SortController {

    @Autowired
    private SortService sortService;

    @GetMapping("/queryAll")
    @ApiOperation("查询全部分类")
    public Result<List<Sort>> sortQueryAll() {
        log.info("查询全部分类");
        List<Sort> sortList = sortService.sortQueryAll();
        return Result.success(sortList);
    }
}
